package cn.s1995.sloth.bizs.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.aliyun.teaopenapi.models.Config;

@Configuration
public class ImageSearchConfig {

	@Value("${imagesearch.access_key_id}")
	private String accessKeyId;

	@Value("${imagesearch.access_key_secret}")
	private String accessKeySecret;

	@Value("${imagesearch.region_id}")
	private String regionId;

	@Value("${imagesearch.endpoint}")
	private String endpoint;

	@Bean("aliImageSearchConfig")
	public Config aliImageSearchConfig() {
		Config authConfig = new Config();
		authConfig.setAccessKeyId(accessKeyId);
		authConfig.setAccessKeySecret(accessKeySecret);
		authConfig.setRegionId(regionId);
		authConfig.setEndpoint(endpoint);
		return authConfig;
	}
}
